package org.dandsoft.blackbox.laboratory.samples.lighter;

/**
 * Created by IntelliJ IDEA.
 * User: dvilyuzhanin
 * Date: 23.03.2009 19:33:43
 */
public class World {

    private int width;
    private int height;
    private Sun sun;
    private Lighter lighter = new Lighter(this);
    private Body body;
    private long time = -1;

    public World(Body body, int width, int height, Sun sun) {
        this.width = width;
        this.height = height;
        this.sun = sun;
        this.body = body;
        lighter.setX(0);
        lighter.setY(0);
        body.setLighter(lighter);
    }


    public void alive() {
        time++;
        sun.alive();
        body.alive();
    }

    public long getTime() {
        return time;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public Sun getSun() {
        return sun;
    }

    public Lighter getLighter() {
        return lighter;
    }
}
